package com.tinckay.common.exception;

import com.baomidou.mybatisplus.extension.api.IErrorCode;
import com.tinckay.common.constant.ResultEnum;

/**
 * 自定义业务异常
 *
 * @author yuanjie
 */
public class ServiceException extends RuntimeException {

    private IErrorCode resultEnum;

    public ServiceException() {
    }

    public ServiceException(IErrorCode resultEnum) {
        this.resultEnum = resultEnum;
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public IErrorCode getResultEnum() {
        return resultEnum;
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }
}
